SetCompressor lzma
Name "Cimer"
OutFile "cimer-0.6-setup.exe"
InstallDir $PROGRAMFILES\Cimer
Icon "..\src\icons\cimer_48x48.ico"
LicenseData "..\COPYING"
LicenseForceSelection checkbox "I agree"
RequestExecutionLevel user

Function .onInit
System::Call 'kernel32::CreateMutexA(i 0, i 0, t "mutex-cimer-installer") i .r1 ?e'
Pop $R0
 
StrCmp $R0 0 +3
  MessageBox MB_OK|MB_ICONEXCLAMATION "The installer is already running."
  Abort
FunctionEnd

Page license
Page directory
Page instfiles

Section ""
SetOutPath $INSTDIR
SetShellVarContext all
File ..\bin\cimer.exe
File ..\bin\timeout.wav
File libgcc_s_dw2-1.dll
File mingwm10.dll
File QtCore4.dll
File QtGui4.dll
writeUninstaller $INSTDIR\uninstaller.exe

CreateDirectory "$SMPROGRAMS\Cimer"
createShortCut "$SMPROGRAMS\Cimer\Cimer.lnk" "$INSTDIR\cimer.exe"
createShortCut "$DESKTOP\Cimer.lnk" "$INSTDIR\cimer.exe"
createShortCut "$SMPROGRAMS\Cimer\Uninstall Cimer.lnk" "$INSTDIR\uninstaller.exe"
SectionEnd



section "Uninstall"
SetShellVarContext all
delete $INSTDIR\cimer.exe
delete $INSTDIR\timeout.wav
delete $INSTDIR\libgcc_s_dw2-1.dll
delete $INSTDIR\mingwm10.dll
delete $INSTDIR\QtCore4.dll
delete $INSTDIR\QtGui4.dll
delete $INSTDIR\uninstaller.exe
RMDir $INSTDIR
delete "$SMPROGRAMS\Cimer\Cimer.lnk"
delete "$DESKTOP\Cimer.lnk"
delete "$SMPROGRAMS\Cimer\Uninstall Cimer.lnk"
RMDir "$SMPROGRAMS\Cimer"
DeleteRegKey HKEY_CURRENT_USER "Software\Cimer\Cimer"
sectionEnd
